package leetcode8;

public class test36 {
    /**
     * 101. 对称二叉树
     * @param root
     * @return
     */
    //递归调用
    public boolean isSymmetric(TreeNode root) {
        if(root == null)return true;
        return recur(root.left,root.right);
    }
    boolean recur(TreeNode L,TreeNode R){
        if(L == null && R == null)return true;
        if(L == null || R == null || L.val != R.val)return false;
        return recur(L.left,R.right) && recur(L.right,R.left);
    }
}
